package com.evan.wj.controller;

import com.evan.wj.pojo.Library;
import com.evan.wj.result.Result;
import com.evan.wj.result.ResultFactory;
import com.evan.wj.service.LibraryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LibraryContraller {
    @Autowired
    LibraryService libraryService;

    @PostMapping("/api/library")
    public Result select(@RequestBody Library library){
        System.out.println(library);
        Library select = libraryService.select(library.getId());
        return ResultFactory.buildSuccessResult(select);
    }
}
